package com.tea.funct.service.impl;

import java.util.List;
import com.tea.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tea.funct.mapper.TeaIncomeMapper;
import com.tea.funct.domain.TeaIncome;
import com.tea.funct.service.ITeaIncomeService;

/**
 * 收益记录Service业务层处理
 * 
 * @author Sophia
 * @date 2024-05-25
 */
@Service
public class TeaIncomeServiceImpl implements ITeaIncomeService 
{
    @Autowired
    private TeaIncomeMapper teaIncomeMapper;

    /**
     * 查询收益记录
     * 
     * @param id 收益记录主键
     * @return 收益记录
     */
    @Override
    public TeaIncome selectTeaIncomeById(Long id)
    {
        return teaIncomeMapper.selectTeaIncomeById(id);
    }

    /**
     * 查询收益记录列表
     * 
     * @param teaIncome 收益记录
     * @return 收益记录
     */
    @Override
    public List<TeaIncome> selectTeaIncomeList(TeaIncome teaIncome)
    {
        return teaIncomeMapper.selectTeaIncomeList(teaIncome);
    }

    /**
     * 新增收益记录
     * 
     * @param teaIncome 收益记录
     * @return 结果
     */
    @Override
    public int insertTeaIncome(TeaIncome teaIncome)
    {
        teaIncome.setCreateTime(DateUtils.getNowDate());
        return teaIncomeMapper.insertTeaIncome(teaIncome);
    }

    /**
     * 修改收益记录
     * 
     * @param teaIncome 收益记录
     * @return 结果
     */
    @Override
    public int updateTeaIncome(TeaIncome teaIncome)
    {
        teaIncome.setUpdateTime(DateUtils.getNowDate());
        return teaIncomeMapper.updateTeaIncome(teaIncome);
    }

    /**
     * 批量删除收益记录
     * 
     * @param ids 需要删除的收益记录主键
     * @return 结果
     */
    @Override
    public int deleteTeaIncomeByIds(Long[] ids)
    {
        return teaIncomeMapper.deleteTeaIncomeByIds(ids);
    }

    /**
     * 删除收益记录信息
     * 
     * @param id 收益记录主键
     * @return 结果
     */
    @Override
    public int deleteTeaIncomeById(Long id)
    {
        return teaIncomeMapper.deleteTeaIncomeById(id);
    }
}
